<?php
/**
 * Created by PhpStorm.
 * User: yhf
 * Date: 2019-01-22
 * Time: 20:05
 */

namespace app\api\model;

use think\Model;

class User extends Model
{
    // 数据隐藏
    protected $hidden = ['create_time','delete_time','update_time'];

    // 通过openid找到用户
    public static function getByOpenID ($id) {
        $user = self::where('id','=',$id)->find();
        return $user;
    }

    // 通过openid找到用户
    public static function getID ($openid)
    {
        $user = self::where('openid', '=', $openid)->find();
    }
}